/** 用户随路数据类 */
export interface IUserData {
	callMediaType?: 'video' | 'audio';
	customerRole?: string;
	formId?: number;
	fullName?: string;
	gender?: string;
	homeAddress?: string;
	idCard?: string;
	isScreenSyncMode?: boolean;
	name?: string;
	phoneNumber?: string;
	receiveMediaType?: 'video' | 'audio';
	service?: string | number;
	specifyAgent?: string | number | null;
	ua?: any;
	userId?: string | number;
	userName?: string;
}

class ClientSubmitInfo {
	private submitInfoMap: Map<string, IUserData>;

	constructor() {
		this.submitInfoMap = new Map();
	}

	public addClientInfo = (clientId: string, userData: IUserData) => {
		this.submitInfoMap.set(clientId, userData);
	};

	public clearClientSubmitInfo = () => {
		this.submitInfoMap.clear();
	};

	public delClientSubmitInfo = (clientId: string) => {
		this.submitInfoMap.delete(clientId);
	};

	public getClientInfo = (clientId: string) => {
		if (this.submitInfoMap.has(clientId)) {
			return this.submitInfoMap.get(clientId)!;
		}
	};
}

export default ClientSubmitInfo;
